const navHeader ={
    state:{
        activeIndex: '',
    },
    getters:{
        activeIndex: state => {
            let activeIndex = state.activeIndex
            if(!activeIndex){
                activeIndex = JSON.parse(window.sessionStorage.getItem('activeIndex') || null)
            }
            return String(activeIndex)
        }
    },
    mutations:{
        setActiveIndex: (state, activeIndex) => {
            state.activeIndex = activeIndex
            window.sessionStorage.setItem('activeIndex', activeIndex)
        }
    },
    actions:{}
}

export default navHeader
